package com.lagou.hdfs.test_1;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * @ClassName WorkSortMapper
 * @Description TODO
 * @Author huangjh5
 * @Date 2020/12/8 11:26
 */
public class WorkSortMapper extends Mapper<LongWritable, Text, LongWritable, NullWritable> {


    private LongWritable key = new LongWritable();


    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {

        key.set(Long.parseLong(value.toString()));
        context.write(key,NullWritable.get());

    }
}
